package com.sun.rocketmq;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;


@Component
@RocketMQMessageListener(
        topic = Demo1Message.TOPIC,
        consumerGroup = "demo1-consumer-group-" + Demo1Message.TOPIC
)
@Slf4j
public class Demo1Consumer implements RocketMQListener<Demo1Message> {
    @Override
    public void onMessage(Demo1Message message) {
        log.info("[onMessage][线程编号:{} 消息内容：{}]", Thread.currentThread().getId(), message);
    }
}
